﻿using System;

namespace Mysoft.Platform.Component.Caches
{
	public interface ICachable
	{
		/// <summary>
		/// 插入缓存
		/// </summary>
		/// <param name="key"></param>
		/// <param name="obj"></param>
		/// <param name="absoluteTime">绝对过期时间，如果小于当前时间则永久缓存</param>
		/// <param name="span">相对过期时间，如果等于0秒则永久缓存</param>
		void Insert(string key, object obj, DateTime absoluteTime, TimeSpan span);
		void Remove(string key);
		void Update(string key, object obj);
		T Get<T>(string key);
	}
}
